/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Model;

/**
 *
 * @author Pisarchik_S
 */
public class Encoder {
    public static  byte[] getBytes(String s)
    {
        try
        {
            return s.getBytes("UTF-8");
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
        return null;
    }

    public static String fromBytes(byte [] arr)
    {
        if (arr == null)
            return "";
        try
        {
            return new String(arr, "UTF-8");
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
        return null;

                
    }
}
